MediaBase = function(options) {
    var self = this
    
    self.url = '/admin/mediabase/popup'
    self.name = 'mediabase'
    self.size = 'width=640,height=480,menubar=no,toolbar=no,location=no,directories=no,resizable=yes,scrollbars=no,status=no'
        
    self.open = function() {
        window.open(self.url, self.name, self.size)
        window.getFileCallback = self.callback
    }
    
    if (options.callback) {
        self.callback = options.callback
    }
    
    if (options.mime) {
        self.url += '/mime/' + options.mime
    }
    
    self.open()
}